<!--{hook thread__list_inc_start.htm}-->

<?php if($threadlist) { foreach($threadlist as &$_thread) { ?>
<li class="media thread tap" data-href="<?php echo $_thread['url']; ?>" tid="<?php echo $_thread['tid'];?>">

    <?php if($_thread['allowtop']) { ?>
    <div class="custom-control custom-checkbox ml-2">
        <input class="custom-control-input" type="checkbox" id="modtid-<?php echo $_thread['tid']; ?>" name="modtid" value="<?php echo $_thread['tid']; ?>" />
        <label class="custom-control-label custom-checkbox" for="modtid-<?php echo $_thread['tid']; ?>">
        </label>
    </div>
    <?php } ?>

    <div class="media-body">
        <div class="media">
            <?php if ($_thread['icon']) { ?>
            <div class="col-4 col-md-3">
                <a href="<?php echo $_thread['url']; ?>" <?php echo (10==$_thread['type']?'rel="nofollow" target="_blank"':''); ?>>
                    <img class="d-block w-100 rounded" src="<?php echo $_thread['icon_fmt'];?>" title='<?php echo $_thread['subject'];?>' alt='<?php echo $_thread['subject'];?>' />
                    <!--{hook thread__list_inc_avatar_after.htm}-->
                </a>
            </div>
            <?php } ?>
            <div class="media-body">

                <!--{hook thread__list_inc_thread_start.htm}-->

                <div class="col-lg-12 subject">

                    <!--{hook thread__list_inc_sticky_before.htm}-->
                    <?php if($_thread['sticky'] > 0) {?>
                    <span class="mr-2 font-weight-bold badge badge-<?php echo $_thread['sticky_class'];?>">
                        Sticky
                    </span>
                    <?php } ?>
                    <!--{hook thread__list_inc_sticky_after.htm}-->

                    <!--{hook thread__list_inc_closed_before.htm}-->
                    <?php if($_thread['closed'] > 0) { ?>
                    <span class="mr-2">
                        <i class="icon-lock text-<?php echo 1==$_thread['closed']?'danger':'dark';?>"></i>
                    </span>
                    <?php } ?>
                    <!--{hook thread__list_inc_closed_after.htm}-->
                    <h2 class="h6 text-break font-weight-bold d-inline">
                        <!--{hook thread__list_inc_subject_before.htm}-->
                        <a href="<?php echo $_thread['url']; ?>" aria-label="<?php echo $_thread['subject'];?>" <?php echo (10==$_thread['type']?'rel="nofollow" target="_blank"':''); ?>>
                        <?php echo $_thread['subject'];?>
                        </a>
                        <!--{hook thread__list_inc_subject_after.htm}-->
                    </h2>
                    <!--{hook thread__list_inc_subject__after.htm}-->
                    <?php if($_thread['files'] > 0) { ?>
                    &nbsp;<i class="icon small filetype other"></i>&nbsp;
                    <?php } ?>
                </div>

                <!--{hook thread__list_inc_brief_before.htm}-->

                <?php if($_thread['brief']){?>
                <div class="col-lg-12 text-break text-muted brief mt-2">
                    <?php echo $_thread['brief'];?>
                </div>
                <?php }?>

                <!--{hook thread__list_inc_tag_before.htm}-->

                <?php if($_thread['tag']){?>
                <div class="tag col-lg-12 text-break d-none d-md-block small text-muted mt-3">
                    <i class="icon-tags mr-2"></i>
                    <?php foreach($_thread['tag_fmt'] as $key => $_tag) {?>
                    <span class="mr-2">
                        <strong class="mb-0">
                            <a class="text-secondary" href="<?php echo url('tag-'.$key);?>">
                                <?php echo $_tag;?>
                            </a>
                        </strong>
                    </span>
                    <?php }?>
                </div>
                <?php }?>

                <!--{hook thread__list_inc_brief_after.htm}-->

                <div class="col-lg-12 d-flex justify-content-between text-grey mt-2">
                    <div class="d-flex">
                        <!--{hook thread__list_inc_avatar_before.htm}-->
                        <a href="<?php echo url('user-' . $_thread['uid']);?>" tabindex="-1" class="mr-2">
                            <img class="avatar-1" src="<?php echo $_thread['user_avatar_url'];?>">
                        </a>
                        <!--{hook thread__list_inc_avatar_after.htm}-->

                        <span class="username mr-1" uid="<?php echo $_thread['uid'];?>">
                            <?php echo $_thread['username'];?>
                        </span>
                        <span class="date d-none d-md-block">
                            <?php echo $_thread['create_date_fmt'];?>
                        </span>
                        <!--{hook thread__list_inc_username_after.htm}-->

                        <!--{hook thread__list_inc_lastuid_before.htm}-->
                        <?php if($_thread['lastuid']) { ?>
                        <span>
                            <span class="mx-1">←</span>
                            <span class="username mr-1" uid="<?php echo $_thread['lastuid'];?>">
                            <?php echo $_thread['lastusername'];?>
                            </span>
                            <span>
                                <?php echo $_thread['last_date_fmt'];?>
                            </span>
                        </span>
                        <?php } ?>
                        <!--{hook thread__list_inc_lastuid_after.htm}-->
                    </div>
                    <div class="d-flex text-muted small">
                        <!--{hook thread__list_inc_views_before.htm}-->
                        <span class="mr-2 d-none d-md-block">
							<i class="icon-eye mr-1"></i>
                            <?php echo format_number($_thread['views']);?>
						</span>
                        <!--{hook thread__list_inc_views_after.htm}-->
                        <span class="mr-2">
							<i class="icon-comment-o mr-1"></i>
                            <?php echo $_thread['posts'];?>
						</span>
                        <!--{hook thread__list_inc_posts_after.htm}-->

                        <?php if($_thread['allowupdate']) { ?>
                        <!--<span class="mr-2">
                            <a href="<?php echo url('content-update', array('tid' => $_thread['tid']), TRUE); ?>" title="<?php echo lang('edit');?>"><i class="icon-edit text-muted"></i></a>
                        </span>-->
                        <!--{hook thread__list_inc_update.htm}-->
                        <?php } ?>
                        <?php if($_thread['allowdelete']) { ?>
                        <!--{hook thread__list_inc_delete.htm}-->
                        <?php } ?>

                    </div>
                </div>

                <!--{hook thread__list_inc_thread_end.htm}-->
            </div>
        </div>
    </div>
</li>
<?php }} else { ?>
<li class="thread mx-3">
    <div><?php echo lang('none');?></div>
</li>
<?php } ?>
<!--{hook thread__list_inc_end.htm}-->